<!--
 * @Descripttion: 
 * @Author: voanit
 * @Date: 2022-09-14 20:54:40
 * @LastEditors: voanit
 * @LastEditTime: 2022-09-14 21:36:09
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./axios.min.js"></script>

</head>

<body>
  123
  <script>
    // function fn () {
    //   axios({
    //     url: 'http://192.168.85.136:5000/news',
    //     method: 'get'
    //   }).then(res => {
    //     console.log(res, 888);
    //   })
    // }
    // fn()
    function fn (msg) {
      console.log(msg, 123);
    }
  </script>
  <!-- 初次进入就可以发送请求获取数据 -->
  <!-- <script src="http://192.168.85.136:5000/news?callback=fn"></script> -->

  <button id="btn">按钮</button>

  <script>
    var btn = document.querySelector('#btn')
    btn.onclick = function () {
      /* 动态创建script标签获取 */
      const script = document.createElement('script')
      // console.log(script, 9);
      script.src = 'http://192.168.85.136:5000/news?callback=fn'
      /* 往body中添加script标签 */
      document.body.appendChild(script)
    }
  </script>




</body>

</html>